'use strict';
module.exports = async (ctx, next) => {
  try {
    await next();
  } catch (e) {
    ctx.body = {
      code: -1,
      message: e.message,
      data: null,
    };
  }
};
